<div id="network-supply-costing-bar2" style="height: 100%">

</div>

<script type="text/javascript">
    var myChart2 = echarts.init(document.getElementById('network-supply-costing-bar2'), 'macarons');
    var option2 = {
        title: {
            text: '',
            show: false
        },
        grid: {
            left: '3%',
            right: '8%',
            bottom: '5%',
            top:'5%',
            containLabel: true
        },
        tooltip: {
            trigger: 'axis'
        },
        toolbox: {

        },
        calculable: true,
        xAxis: [
            {
                type: 'category',
                axisLabel:{
                    show:true,
                    textStyle:{
                        color:"#595959"
                    }
                },
                axisLine: {
                    show: false
                },
                axisTick: {
                    show: false
                },
            }
        ],
        yAxis: [
            {
                type: 'value',
                axisLine: {
                    show: false
                },
                axisTick: {
                    show: false
                },
                axisLabel: {
                    formatter: function(value){
                        var var1=value*1;
                        return var1;
                    },
                    textStyle:{
                        color:"#595959"
                    }
                },
                splitLine:{
                    show:true
                },
                splitArea: {
                    show: true,
                    areaStyle: {
                        color: ['rgba(0,0,0,0)', 'rgba(0,0,0,0)']
                    }
                },
            }
        ],
        legend: {

        },
        series: [
            {
                name: '数量',
                type: 'line',
                barWidth:30,
                itemStyle: {
                    normal: {
                        //好，这里就是重头戏了，定义一个list，然后根据所以取得不同的值，这样就实现了，
                        color: function(params) {
                            // build a color map as your need.
                            var colorList = [
                                '#0fa99d','#d9d9d9','#4472c4','#c9eee7','#e7a14c',
                                '#787473','#9BCA63','#FAD860','#F3A43B','#60C0DD',
                                '#D7504B','#C6E579','#F4E001','#F0805A','#26C0C0'
                            ];
                            if(params.dataIndex<15){
                                return  colorList[params.dataIndex];
                            }
                            if(params.dataIndex>15){
                                var i=params.dataIndex/15;
                                i=Math.floor(i);
                                var j=params.dataIndex-i*15;
                                return colorList[j];
                            }
                        },
                        //以下为是否显示，显示位置和显示格式的设置了
                    }}
            }
        ]
    };
    myChart2.setOption(option2);
    function loadbar2(d) {
        if (d.data) {
            option2.xAxis = [
                {
                    type: 'category',
                    data: d.data.arr3
                }
            ];
            option2.series[0].data = d.data.arr4;
            myChart2.setOption(option2);
        }else{
            var div1="<div type='text' style='padding-top:15%' class=' text-center '>"+d.message+"</div>";
            $("#network-supply-costing-bar2").empty();
            $("#network-supply-costing-bar2").prepend(div1);
        }
    }

</script>